cd myproject

#STATIC_ROOT = os.path.join(BASE_DIR, 'reactapp/public/static')
python manage.py collectstatic --noinput  # 把静态文件收集到STATIC_ROOT(reactapp/public/static)

cd reactapp  # myproject/reactapp
npm run build # 创建build目录，并把collectstatic收集到的静态文件(reactapp/public/static/目录下的文件）一同放到reactapp/build/static目录下

cd ..  # 回到django项目的根目录myproject
gunicorn myproject.wsgi:application -w 4 -b 0.0.0.0:8000 -k gthread --threads 50

# 注意用户上传的文件必须在build/media/目录下，不然前端代码访问不到
# MEDIA_ROOT = os.path.join(BASE_DIR, 'reactapp/build/media')  # 用户上传文件的目录
